<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Assimp: aiCamera Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Assimp
   &#160;<span id="projectnumber">v3.0 (July 2012)</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="structai_camera.html#pub-methods">Public Member Functions</a> &#124;
<a href="structai_camera.html#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">aiCamera Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Helper structure to describe a virtual camera.  
 <a href="structai_camera.html#details">More...</a></p>

<p><a href="structai_camera-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad59fb38789f50053223511d5b18c96e5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#ad59fb38789f50053223511d5b18c96e5">aiCamera</a> ()</td></tr>
<tr class="memitem:a6621e7b2fed0871fe7f88d5d065f19cd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#a6621e7b2fed0871fe7f88d5d065f19cd">GetCameraMatrix</a> (<a class="el" href="matrix4x4_8h.html#a4bd7df03fb0907421d6b7068e172b911">aiMatrix4x4</a> &amp;out) const </td></tr>
<tr class="memdesc:a6621e7b2fed0871fe7f88d5d065f19cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a <em>right-handed</em> camera matrix from me.  <a href="structai_camera.html#a6621e7b2fed0871fe7f88d5d065f19cd"></a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ae414556eaa6f910b5927f465d97bf70c"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#ae414556eaa6f910b5927f465d97bf70c">mAspect</a></td></tr>
<tr class="memdesc:ae414556eaa6f910b5927f465d97bf70c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Screen aspect ratio.  <a href="structai_camera.html#ae414556eaa6f910b5927f465d97bf70c"></a><br/></td></tr>
<tr class="memitem:aa9ccf77e3d7ca3dc8f46df931b65172f"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#aa9ccf77e3d7ca3dc8f46df931b65172f">mClipPlaneFar</a></td></tr>
<tr class="memdesc:aa9ccf77e3d7ca3dc8f46df931b65172f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Distance of the far clipping plane from the camera.  <a href="structai_camera.html#aa9ccf77e3d7ca3dc8f46df931b65172f"></a><br/></td></tr>
<tr class="memitem:a720e8c94c036dcefe4b13cc1c69c521e"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#a720e8c94c036dcefe4b13cc1c69c521e">mClipPlaneNear</a></td></tr>
<tr class="memdesc:a720e8c94c036dcefe4b13cc1c69c521e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Distance of the near clipping plane from the camera.  <a href="structai_camera.html#a720e8c94c036dcefe4b13cc1c69c521e"></a><br/></td></tr>
<tr class="memitem:adcdea73ece19ea0a9068f5544ec23592"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#adcdea73ece19ea0a9068f5544ec23592">mHorizontalFOV</a></td></tr>
<tr class="memdesc:adcdea73ece19ea0a9068f5544ec23592"><td class="mdescLeft">&#160;</td><td class="mdescRight">Half horizontal field of view angle, in radians.  <a href="structai_camera.html#adcdea73ece19ea0a9068f5544ec23592"></a><br/></td></tr>
<tr class="memitem:abfc17fe405597f605e79e57266baf0a5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vector3_8h.html#a47f446977120a9ca7d868353aad70b09">aiVector3D</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#abfc17fe405597f605e79e57266baf0a5">mLookAt</a></td></tr>
<tr class="memdesc:abfc17fe405597f605e79e57266baf0a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">'LookAt' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node.  <a href="structai_camera.html#abfc17fe405597f605e79e57266baf0a5"></a><br/></td></tr>
<tr class="memitem:a45d22fa994baee4ba9affd7dca4a03e3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structai_string.html">aiString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#a45d22fa994baee4ba9affd7dca4a03e3">mName</a></td></tr>
<tr class="memdesc:a45d22fa994baee4ba9affd7dca4a03e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">The name of the camera.  <a href="structai_camera.html#a45d22fa994baee4ba9affd7dca4a03e3"></a><br/></td></tr>
<tr class="memitem:ae5fa6f4afbb059e8a4d42fa13b20c908"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vector3_8h.html#a47f446977120a9ca7d868353aad70b09">aiVector3D</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#ae5fa6f4afbb059e8a4d42fa13b20c908">mPosition</a></td></tr>
<tr class="memdesc:ae5fa6f4afbb059e8a4d42fa13b20c908"><td class="mdescLeft">&#160;</td><td class="mdescRight">Position of the camera relative to the coordinate space defined by the corresponding node.  <a href="structai_camera.html#ae5fa6f4afbb059e8a4d42fa13b20c908"></a><br/></td></tr>
<tr class="memitem:a8a8ff4f2598becb6249efcdbad635a71"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vector3_8h.html#a47f446977120a9ca7d868353aad70b09">aiVector3D</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structai_camera.html#a8a8ff4f2598becb6249efcdbad635a71">mUp</a></td></tr>
<tr class="memdesc:a8a8ff4f2598becb6249efcdbad635a71"><td class="mdescLeft">&#160;</td><td class="mdescRight">'Up' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node.  <a href="structai_camera.html#a8a8ff4f2598becb6249efcdbad635a71"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Helper structure to describe a virtual camera. </p>
<p>Cameras have a representation in the node graph and can be animated. An important aspect is that the camera itself is also part of the scenegraph. This means, any values such as the look-at vector are not <em>absolute</em>, they're <b>relative</b> to the coordinate system defined by the node which corresponds to the camera. This allows for camera animations. For static cameras parameters like the 'look-at' or 'up' vectors are usually specified directly in <a class="el" href="structai_camera.html" title="Helper structure to describe a virtual camera.">aiCamera</a>, but beware, they could also be encoded in the node transformation. The following (pseudo)code sample shows how to do it: <br/>
<br/>
 </p>
<div class="fragment"><div class="line">   <span class="comment">// Get the camera matrix for a camera at a specific time</span></div>
<div class="line">   <span class="comment">// if the node hierarchy for the camera does not contain</span></div>
<div class="line">   <span class="comment">// at least one animated node this is a static computation</span></div>
<div class="line">   <span class="keyword">get</span>-camera-matrix (node sceneRoot, camera cam) : matrix</div>
<div class="line">   {</div>
<div class="line">      node   cnd = find-node-<span class="keywordflow">for</span>-camera(cam)</div>
<div class="line">      matrix cmt = identity()</div>
<div class="line">  </div>
<div class="line">      <span class="comment">// as usual - get the absolute camera transformation for this frame</span></div>
<div class="line">      for each node nd in hierarchy from sceneRoot to cnd</div>
<div class="line">        matrix cur</div>
<div class="line">        if (is-animated(nd))</div>
<div class="line">           cur = eval-animation(nd)</div>
<div class="line">        else cur = nd-&gt;mTransformation;</div>
<div class="line">        cmt = mult-matrices( cmt, cur )</div>
<div class="line">      end for</div>
<div class="line">  </div>
<div class="line">      <span class="comment">// now multiply with the camera&#39;s own local transform</span></div>
<div class="line">      cam = mult-matrices (cam, get-camera-matrix(cmt) )</div>
<div class="line">   }</div>
</div><!-- fragment --><dl class="section note"><dt>Note:</dt><dd>some file formats (such as 3DS, ASE) export a "target point" - the point the camera is looking at (it can even be animated). <a class="el" href="namespace_assimp.html" title="Assimp&#39;s CPP-API and all internal APIs.">Assimp</a> writes the target point as a subnode of the camera's main node, called "&lt;camName&gt;.Target". However this is just additional information then the transformation tracks of the camera main node make the camera already look in the right direction. </dd></dl>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad59fb38789f50053223511d5b18c96e5"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">aiCamera::aiCamera </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a6621e7b2fed0871fe7f88d5d065f19cd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void aiCamera::GetCameraMatrix </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="matrix4x4_8h.html#a4bd7df03fb0907421d6b7068e172b911">aiMatrix4x4</a> &amp;&#160;</td>
          <td class="paramname"><em>out</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get a <em>right-handed</em> camera matrix from me. </p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">out</td><td>Camera matrix to be filled </td></tr>
  </table>
  </dd>
</dl>
<p>todo: test ... should work, but i'm not absolutely sure</p>
<p>We don't know whether these vectors are already normalized ... </p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="ae414556eaa6f910b5927f465d97bf70c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float aiCamera::mAspect</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Screen aspect ratio. </p>
<p>This is the ration between the width and the height of the screen. Typical values are 4/3, 1/2 or 1/1. This value is 0 if the aspect ratio is not defined in the source file. 0 is also the default value. </p>

</div>
</div>
<a class="anchor" id="aa9ccf77e3d7ca3dc8f46df931b65172f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float aiCamera::mClipPlaneFar</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Distance of the far clipping plane from the camera. </p>
<p>The far clipping plane must, of course, be further away than the near clipping plane. The default value is 1000.f. The ratio between the near and the far plane should not be too large (between 1000-10000 should be ok) to avoid floating-point inaccuracies which could lead to z-fighting. </p>

</div>
</div>
<a class="anchor" id="a720e8c94c036dcefe4b13cc1c69c521e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float aiCamera::mClipPlaneNear</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Distance of the near clipping plane from the camera. </p>
<p>The value may not be 0.f (for arithmetic reasons to prevent a division through zero). The default value is 0.1f. </p>

</div>
</div>
<a class="anchor" id="adcdea73ece19ea0a9068f5544ec23592"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float aiCamera::mHorizontalFOV</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Half horizontal field of view angle, in radians. </p>
<p>The field of view angle is the angle between the center line of the screen and the left or right border. The default value is 1/4PI. </p>

</div>
</div>
<a class="anchor" id="abfc17fe405597f605e79e57266baf0a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="vector3_8h.html#a47f446977120a9ca7d868353aad70b09">aiVector3D</a> aiCamera::mLookAt</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>'LookAt' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node. </p>
<p>This is the viewing direction of the user. The default value is 0|0|1. The vector may be normalized, but it needn't. </p>

</div>
</div>
<a class="anchor" id="a45d22fa994baee4ba9affd7dca4a03e3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structai_string.html">aiString</a> aiCamera::mName</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The name of the camera. </p>
<p>There must be a node in the scenegraph with the same name. This node specifies the position of the camera in the scene hierarchy and can be animated. </p>

</div>
</div>
<a class="anchor" id="ae5fa6f4afbb059e8a4d42fa13b20c908"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="vector3_8h.html#a47f446977120a9ca7d868353aad70b09">aiVector3D</a> aiCamera::mPosition</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Position of the camera relative to the coordinate space defined by the corresponding node. </p>
<p>The default value is 0|0|0. </p>

</div>
</div>
<a class="anchor" id="a8a8ff4f2598becb6249efcdbad635a71"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="vector3_8h.html#a47f446977120a9ca7d868353aad70b09">aiVector3D</a> aiCamera::mUp</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>'Up' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node. </p>
<p>The 'right' vector of the camera coordinate system is the cross product of the up and lookAt vectors. The default value is 0|1|0. The vector may be normalized, but it needn't. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="camera_8h.html">camera.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jul 10 2012 17:55:53 for Assimp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
